package com.example.mvp.im.observr

import android.os.Message
import java.util.*

/**
 * 网络观察
 * @author  chaohaipeng  on 2018/8/22.
 */
class NetObservable : Observable() {
    private object mHolder {
        val instance = NetObservable()
    }
    companion object {
        fun getInstance(): NetObservable {
            return mHolder.instance
        }
    }

    /**
     * 主动通知新消息
     */
    fun onNewMessage(content: Int) {
        setChanged()
        notifyObservers(content)
    }
}